/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.ruipengkj.commons.util.Util;

/**
 * 说明： Entity Name 商品毛利润表
 * 
 * @Date：2012-03-14
 */
@Entity
@Table(name = "ruipengkj_view_profit_commodity")
public class ViewProfitCommoditySummary implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private String id;// 商品ID
	private String name;//商品名称
	private String unit;//单位
	private int totalNum;// 销售数量
	private Double totalBatchPrice;//销售成本
	private Double totalPrice;//销售金额
	private Double profit;// 利润
	private Double profitRate;// 利润率
	
	@Id
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public int getTotalNum() {
		return totalNum;
	}
	public void setTotalNum(int totalNum) {
		this.totalNum = totalNum;
	}
	public Double getTotalBatchPrice() {
		if (totalBatchPrice != null && totalBatchPrice != 0)
			totalBatchPrice = Util.DoubleHowMany(1, totalBatchPrice);
		return totalBatchPrice;
	}
	public void setTotalBatchPrice(Double totalBatchPrice) {
		this.totalBatchPrice = totalBatchPrice;
	}
	public Double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}
	public Double getProfit() {
		if (profit != null && profit != 0)
			profit = Util.DoubleHowMany(1, profit);
		return profit;
	}
	public void setProfit(Double profit) {
		this.profit = profit;
	}
	public Double getProfitRate() {
		if (profitRate != null) {
			profitRate = Util.DoubleHowMany(2, profitRate);
		}
		return profitRate;
	}
	public void setProfitRate(Double profitRate) {
		this.profitRate = profitRate;
	}
	
	
}
